package com.jqb.pattern.composite;

public class Client {

	public static void main(String[] args) {
		/**
		 * 最终测试的是composite2
		 * 
		 */
		Composite composite1 = new Composite();
		Composite composite2 = new Composite();
		Leaf leaf1=new Leaf();
		Leaf leaf2=new Leaf();
		Leaf leaf3=new Leaf();
		Leaf leaf4=new Leaf();
		composite1.add(leaf1);
		composite1.add(leaf2);
		composite2.add(leaf3);
		composite2.add(leaf4);
		composite2.add(composite1);
		composite2.doSth();
	}
}
